<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/mui.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">用户详情</h1>
		</header>
		<div class="mui-content">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img id="avatar" class="mui-media-object mui-pull-left" src="">
						<div class="mui-media-body">
							<p id="nickname"></p>
							<p class="mui-ellipsis" id="username">能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
			</ul>

			<ul class="mui-table-view">
				<li class="mui-table-view-cell" id="toy_manager">
					<a class="mui-navigate-right">
						<i class="mui-icon mui-icon-qq"></i>管理我的玩具
					</a>
				</li>
			</ul>
			<button type="button" class="mui-btn mui-btn-red mui-btn-block" id="logout_btn">退出登陆</button>
		</div>
		<!--<button type="button" class="mui-btn mui-btn-blue mui-btn-block">退出登陆</button>-->
		<script src="js/mui.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init();
			mui.back = function() {};
			var Sdata = null;
			mui.plusReady(function() {
				Sdata = plus.webview.currentWebview();
				document.getElementById("avatar").src = "avatar/" + Sdata.avatar;
				document.getElementById("username").innerText = Sdata.username;
				document.getElementById("nickname").innerText = Sdata.nickname;
			});

			document.getElementById('logout_btn').addEventListener('tap', function() {
				window.localStorage.removeItem("user_id");
				mui.openWindow({
					url: "login.html",
					id: "login.html",
					styles: {
						top: "0px",
						bottom: "50px"
					}
				})
			});

			document.getElementById('toy_manager').addEventListener('tap', function() {
				mui.openWindow({
					url: "toy_manager.html",
					id: "toy_manager.html"
				})
			})
		</script>
	</body>

</html>